<script setup>
import { defineEmits, defineProps } from 'vue'
import {useRouter} from 'vue-router'

const emit = defineEmits('cancel')

const props = defineProps({
  title: {
    required: true,
    type: [String, Number],
  },
  back: {
    required: false,
    type: Boolean
  },
  path: String
})

const router = useRouter()

const goBackClick = () => {
  emit('cancel')
}
</script>

<template>
  <div class="header">
    <div @click="goBackClick" v-if="props.back" class="back">
      <img src="@/assets/images/icons/left.png" alt="">
    </div>
    <div v-else class="none"></div>
    <h1>{{ props.title }}</h1>
    <div class="none"></div>
  </div>
</template>

<style scoped lang="scss">
.header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.6rem;
  padding: 0 1.2rem;
  flex-shrink: 0;
  h1{
    font-size: 1.6rem;
    color: #333333;
    font-weight: bold;
  }
}
</style>